From 149f34a1dbc8e4710518eaa856aa890cf7a9efd5 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Thu, 18 Jan 2001 12:26:54 +0000 Subject: [PATCH] (forward_to_next_line_start): Stop at end of buffer when searching for a newline. --- src/xdisp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xdisp.c b/src/xdisp.c index 6ca639bcbfa..2354eaa6209 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -3511,7 +3511,8 @@ forward_to_next_line_start (it, skipped_p) !newline_found_p && n < MAX_NEWLINE_DISTANCE; n += STRINGP (it->string) ? 0 : 1) { - get_next_display_element (it); + if (!get_next_display_element (it)) + break; newline_found_p = it->what == IT_CHARACTER && it->c == '\n'; set_iterator_to_next (it, 0); } -- 2.30.2